Release: [jQuery Plugin] Endless Scroll

您所在的位置:网站首页 scrollto is not a function Release: [jQuery Plugin] Endless Scroll

Release: [jQuery Plugin] Endless Scroll

#Release: [jQuery Plugin] Endless Scroll | 来源: 网络整理| 查看: 265

Please check the GitHub repository for the latest release.

If you don’t already know, endless scroll (or infinite scrolling) is a popular technique among web 2.0 sites such as Google Reader and Live Image Search, where instead of paging through items using the traditional pagination technique, the page just keeps loading with new items attached to the end.

I have developed a jQuery plugin to easily achieve this.

Requirement: jQuery 1.2+

The plugin is tested with jQuery 1.2.6, 1.3 and 1.4.

There are a few options to customise the behaviour of this plugin:

bottomPixels (integer) – the number of pixels from the bottom of the page that triggers the event fireOnce (boolean) – only fire once until the execution of the current event is completed fireDelay (integer) – delay the subsequent firing, in milliseconds. 0 or false to disable delay. loader (string) – HTML loader data (string) – plain HTML data insertAfter (string) – jQuery selector syntax: where to put the loader as well as the plain HTML data callback (function) – callback function, accepets one argument: fire sequence (the number of times the event triggered during the current page session) resetCounter (function) – resets the fire sequence counter if the function returns true, this function could also perform hook actions since it is applied at the start of the event

In a typical scenario, you won’t be using the ‘data’ option, but rather the ‘callback’ option. You may use it to trigger an AJAX call and updates/inserts your page content.

Usage // using default options $(document).endlessScroll(); // using some custom options $(document).endlessScroll({ fireOnce: false, fireDelay: false, loader: "", callback: function(p){ alert("test"); } }); Demo

Click here for a simple demo.

Download / Source Code

Changelog

v1.4.2 [2011-01-08]

Fixed a bug where calling the script on $(document) would fail.

v1.4.1 [2010-06-18]

Fixed a bug where the callback fires when the inner wrap hasn’t been created.

v1.4 [2010-06-18]

Endless Scroll now works with any elements, not just $(document)!

v1.3 [2009-04-20]

Fixed a bug caused by ‘fireDelay‘.

v1.2 [2009-01-16]

Added ‘resetCounter‘ option.

v1.1 [2009-01-15]

Added ‘fireDelay‘ option.

v1.0 [2009-01-15]

Initial release. Digg DZone del.icio.us Facebook Mixx Google Bookmarks LinkedIn Live Reddit Slashdot StumbleUpon Technorati Twitter Related posts jQuery Endless Scroll Updated (0) Release: [jQuery Plugin] Slideshow Lite (63) jQuery Slideshow Lite Plugin Updated (Major Rewrite) (1) Oh, where did my theme go? (1) jQuery problems in IE? It could be SWFObjects. (5)

Tags: AJAX, endless, infinite, javascript, jQuery, js, plugin, scroll, scrolling

This entry was posted on Thursday, January 15th, 2009 at 12:31 pm and is filed under Releases, jQuery. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3